docs(vm): clarify --ssh-public-key creates user from key comment#708
Open
docs(vm): clarify --ssh-public-key creates user from key comment#708
Conversation
The --ssh-public-key flag accepts the key, but the Linux user that receives it is derived from the key's comment (the portion before the first '@'). The help text did not mention this, so users assumed the key would land on the same user `vm ssh-endpoint` returns (the Vendor Portal GitHub username) and SSH attempts as that user failed. Update the flag descriptions and the shared long help for ssh-endpoint/scp-endpoint, and add an end-to-end create-then-ssh example. Also bump stale Ubuntu 20.04 references in the example block to 22.04, since 20.04 is not in the supported version list.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
replicated vm create --ssh-public-keyaccepts the key fine, but the Linux user the key gets added to on the VM is derived from the key's comment (the portion before the first@). The help text didn't mention this, so users assumed the key would land onubuntuor on the Vendor Portal GitHub username thatvm ssh-endpointreturns, and SSH as that user failed.--ssh-public-keyflag description, the shared long help forvm ssh-endpoint/vm scp-endpoint, and the--usernameflag description to call out the create→endpoint username relationship. Added an end-to-end example tovm createshowingssh-keygen -C ci@host→vm create --ssh-public-key→vm ssh-endpoint --username ci→ssh -i.--version 20.04references in the example block to22.04(20.04 is no longer in the supported version list returned byvm versions --distribution ubuntu).No behavior changes — help text only.
Verified the underlying behavior end-to-end against a real CMX VM: created an Ubuntu 22.04 VM with a key whose comment was
joshtester@laptop42, confirmed userjoshtester(uid 1002) was provisioned with the key in~/.ssh/authorized_keysand passwordless sudo, whilessh ubuntu@…and the usernamevm ssh-endpointreturned both fail.Refs sc-136594.
Test plan
go build ./...cleanreplicated vm create --helprenders new flag description and the new examplereplicated vm ssh-endpoint --helprenders new long-help paragraph and updated--usernamedescriptionreplicated vm scp-endpoint --helppicks up the same shared note (correct — same gotcha applies)